<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"
	import="com.hengpeng.itfinbase.persist.Comment,com.hengpeng.common.util.CalendarUtil"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<%
	Comment comment = (Comment) request.getAttribute("comment");
	String postTime = "";
	if (comment.getPostTime() != null
			&& comment.getPostTime().toString().trim().length() > 0)
		postTime = CalendarUtil.LONG_DATE_FORMAT_NOMM.format(comment
				.getPostTime());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>详细页</title>
<style type="text/css">
		.clobody{height: 33px;line-height: 33px;}
		.clobody .title{font-weight: bold;color: #fff;font-size:16px;padding-left: 8px;}
		.clobody a{display:block; height:16px; text-indent:-1000px; overflow:hidden;white-space:nowrap;background:url(<spring:url value="/" />images/icon_thinkbox.png) no-repeat; width: 45px;padding-right: 10px;}
		.clobody a:hover{background:url(<spring:url value="/" />images/icon_thinkbox.png) no-repeat 0 -16px;}
		.ttcx4{position:fixed;top:30%;text-align:center;left:0px;width:100%;z-index:9999;margin: 0 auto;}
		.ttcx4 ul{padding: 0px 3px 0px 0px;}
		.warp_ball{width: 500px;margin: 0px auto;text-align: center;border: 1px solid #004B96;background: url(<spring:url value="/" />images/icon_thinkbox.png) repeat-x 0 -32px;}
		.zz_body{position:absolute;left:0px;top:0px;display:none;width:100%;background:#000000; z-index:59;filter:alpha(Opacity=40);-moz-opacity:0.4;opacity:0.4;}
		.storename_show{height: 100%;overflow: auto;padding: 6px 0 5px 5px;background: #fff;}
		
		.choose_bt{font-weight: 800;color: #fff;display:block;padding-right: 10px;}
		.choose_bt label{cursor: pointer;}

		a.showbtbg{background:url(<spring:url value="/" />images/bt.gif) no-repeat; width: 97px;height: 31px;display: block;line-height: 31px;color: #fff;font-size: 14px;font-weight: 800;text-decoration: none;margin: 0 auto;}
</style>
</head>
<body>
<div class="youarehere">网站内容管理 &gt; <span>管理留言</span>&gt; <span>详情</span></div>
	<table width="100%" cellspacing="0" cellpadding="0" border="0"
		align="center">
		<tbody>
			<tr>
				<td>
					<form onsubmit="" method="post"
						action="<chtml:path path="/" />cmtm/${comment.id}" name="commentForm">
						<table cellspacing="0" cellpadding="0" align="center"
							class="data_table_main">
							<tbody>
								<tr>
									<td background="<chtml:path path="/" />layout/list/tab_top.gif">
										<!-- comment标题头 -->
										<table cellspacing="0" cellpadding="0" border="0"
											class="data_table_title">
											<tbody>
												<tr>
													<td width="12" height="30"><img width="12" height="30"
														src="<chtml:path path="/" />layout/list/tab_left_top.gif" /></td>
													<td align="left">留言详情</td>
													<td align="right">&nbsp;</td>
													<td width="16"><img width="16" height="30"
														src="<chtml:path path="/" />layout/list/tab_right_top.gif" /></td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
								<tr>
									<td>
										<table width="100%" cellspacing="0" cellpadding="0" border="0">
											<tbody>
												<tr>
													<td width="8"
														background="<chtml:path path="/" />layout/list/tab_left.gif">&nbsp;</td>
													<td>
														<!-- comment数据区 -->
														<table cellspacing="1" cellpadding="4" align="center"
															class="data_table_command" style="margin-top: 0">
															<tbody>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">留言人</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.commUserName
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">留言类型</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.commentType.text
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">留言时间</td>
																	<td class="data_tab_tdl" nowrap="nowrap"><%=postTime%></td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">主题</td>
																	<td class="data_tab_tdl" >
																	  ${comment.title}
																	</td>
																		
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">内容</td>
																	<td class="data_tab_tdl">
																	   ${comment.content}
																	</td> 
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">联系方式</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.contact
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">留言人IP</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.ip
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">会员店编号</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.storeId
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">是否通过审核</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.auditState.text
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">回复状态</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.replyState.text
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">是否屏蔽</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.isHidden.text
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">是否公开</td>
																	<td class="data_tab_tdl" nowrap="nowrap">${comment.isPublic.text
																		}</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right">回复人</td>
																	<td class="data_tab_tdl" nowrap="nowrap">
																	  <c:if test="${empty comment.replyUserName}">
																			${sessionScope.CUR_USER_INFO.userId}
																	  </c:if>
																	  <c:if test="${!empty comment.replyUserName}">
																	        ${comment.replyUserName }
																	   </c:if>
																	</td>
																</tr>
																<tr>
																	<td width="120" class="data_tab_tdr" nowrap="nowrap"
																		align="right" id="reply_text">回复</td>
																	<td class="data_tab_tdl" nowrap="nowrap">
																	${comment.reply}
																	<input type="hidden" id="reply" name="reply" value="${comment.reply}"/>
																	</td>
																</tr>
																<tr>
																	<td colspan="2" class="bg_bai">
																	
																		<div class="mr_20 t_c">								
																			<input type="button" class="pub_bt" id="confirm_pass" value="通过审核" onclick="javascript:pass(${comment.id})" />
																			<input type="button" class="pub_bt" id="confirm_hidden" value="屏蔽留言 " onclick="javascript:doHidden(${comment.id})" />
																			<input type="button" class="pub_bt" value="返回 " onclick="javascript:void(history.back(-1))" />
																		</div>	
																		
																	</td>
																</tr>
															</tbody>
														</table>
													</td>
													<td width="8"
														background="<chtml:path path="/" />layout/list/tab_right.gif">&nbsp;</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
								<tr>
									<td
										background="<chtml:path path="/" />layout/list/tab_bottom.gif">
										<table cellspacing="0" cellpadding="0" align="center"
											class="data_table_pagination">
											<tbody>
												<tr>
													<td width="12" height="35"><img width="12" height="35"
														src="<chtml:path path="/" />layout/list/tab_left_bottom.gif" /></td>
													<td>&nbsp;</td>
													<td width="16"><img width="16" height="35"
														src="<chtml:path path="/" />layout/list/tab_right_bottom.gif" /></td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
							</tbody>
						</table>
						<!-- comment结束 -->
						<input type="hidden" id="isHidden" name="isHidden" value="${comment.isHidden }" />
						<input type="hidden" id="auditState" name="auditState" value="${comment.auditState }" />
					</form>
				</td>
			</tr>
		</tbody>
	</table>
<!--登录蒙层效果-->
<div class="zz_body" id="zz_body"></div>
<!--登录蒙层效果-->
<div id="ttcx4" class="ttcx4" style="display: none;">
<div class="warp_ball">
<div class="clobody">
		<div class="title l" id="show_title"></div>
		<div class="r">
			<a href="javascript:close();" title="关闭"  class="r">关闭</a>
		</div>
</div>
<div class="storename_show">
<div style="height: 145px;overflow:auto;overflow-y:auto;">
<style type="text/css">
	.opertar_context{width: 98%;margin: 0 auto;text-align: left;line-height: 26px;}
</style>
	<div class="opertar_context">
		<table cellspacing="1" cellpadding="4" align="center" class="data_table_command">
		<tbody>
		<tr>
		<td class="data_tab_tdr" nowrap="nowrap" align="right">内容:</td>
		<td class="data_tab_tdl" nowrap="nowrap">
		<textarea id="temp_reply" name="temp_reply" rows="6">${comment.reply}</textarea></td>
		</tr>
		<tr>
			<td height="25" align="center" class="data_tab_td" colspan="2">
				<input type="button" id="confirm_huifu" value="确 定" onclick="javascript:submitForm()"/>														
			</td>
		</tr>
		</tbody>
		</table>
	</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var path = "<%=request.getContextPath()%>";
var _pb_state = "${comment.isHidden}";
var _reply_state = "${comment.replyState}";
if(_pb_state=="YES" || _reply_state== "YES")
{
	if(_pb_state == "YES")
	{
		$("#reply_text").text("跟踪处理结果");
	}
	$("#confirm_hidden").hide();
	$("#confirm_pass").hide();
}
function pass(id)
{	
	$("#auditState").val("YES");
	showTtcx4("回复");
	/*
	var _check = document.getElementById("auditState").value;
	if(_check == "YES")
	{
		alert("此留言已经审核通过！");
		return;
	}
	helper.fun.send(path+'/cmtm/check/'+id,null,function(flag){
		var _is_pass = flag;
		if(_is_pass=='YES'){
			alert("审核留言成功！");
			document.getElementById("confirm_pass").disabled = true;
			showTtcx4("回复");
		}
		else{
			alert("审核留言失败！");
			}
		});
	*/
}

function doHidden(id)
{	
	$("#isHidden").val("YES");
	showTtcx4("跟踪处理结果");
	/*
	var _hidden = document.getElementById("isHidden").value;
	if(_hidden == "YES")
	{
		alert("此留言已经屏蔽！");
		return;
	}
	helper.fun.send(path+'/cmtm/hidden/'+id,null,function(flag){
		var is_hidden = flag;
		if(is_hidden=='YES'){
			alert("屏蔽留言成功！");
			document.getElementById("confirm_hidden").disabled = true;
			showTtcx4("跟踪处理结果");
			}
		else{
			alert("屏蔽留言失败！");
			}
		});
	*/
}

//回复递交表单
function submitForm(){
	$("#reply").val($("#temp_reply").val());
	var reply  = document.getElementById("reply").value;
	if(reply.length > 1000){
		alert("回复内容不能超过1000个字符。");
		return;
	}else if(reply == null || reply.trim() == ""){
		alert("回复内容不能为空!");
		return;
	}
	document.forms['commentForm'].submit();
}
function showTtcx4(title){
	$("#show_title").text(title);
	$("#ttcx4").show();
	$("#zz_body").show();
	hei = $(document).height();
	$("#zz_body").css("height",hei);
}
function close(){
	$("#ttcx4").hide();
	$("#zz_body").hide();
}
</script>
<!--说明   -->	
<div class="sm_info">
	<p class="row_one">说明：</p>
	<p class="other"></p>
	<p class="other"></p>
</div>
</body>
</html>

